package com.fivestar.finance.app.ui.account;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.fivestar.finance.app.R;


/**
 * Created by next on 2016/8/24.
 */

public class MyRecycerViewAdapter extends RecyclerView.Adapter<MyRecycerViewAdapter.MyViewHodler> {


    String[] strs = {"我的店铺","我的乡亲们","我的白条钱包","我的星币","我的邀请码","关于我们","设置"};

    public MyRecycerViewAdapter() {
    }

    @Override
    public MyViewHodler onCreateViewHolder(ViewGroup parent, int viewType) {

        LayoutInflater inflater = LayoutInflater.from(parent.getContext());
        View childView = inflater.inflate(R.layout.item_recycerview_my, parent, false);
        MyViewHodler viewHolder = new MyViewHodler(childView);
        return viewHolder;

    }

    @Override
    public void onBindViewHolder(MyViewHodler holder, int position) {
        holder.tv.setText(strs[position]);
    }

    @Override
    public int getItemCount() {
        return 7;
    }

    class MyViewHodler extends RecyclerView.ViewHolder {
        TextView tv;

        public MyViewHodler(View itemView) {
            super(itemView);
            tv = (TextView) itemView.findViewById(R.id.tv_item_my);
        }
    }
}
